export class Result {
    private code: number;
    private message: string;
    private data: any;
    private timestamp: string;
    constructor(data: any, message?: string, code?: number) {
        this.data = data;
        this.code = code || 200;
        this.message = message || '请求成功';
        this.timestamp = Date.now().toString();
    }
    public static success(data: any, message?: string) {
        return new Result(data, message)
    }
    public static error(message: string, code: number,) {
        return new Result(false, message, code)
    }
}